<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>后台管理系统</title>
<js href="__PUBLIC__/Js/Jquery/jquery-1.4.4.min.js" />
<link href="../Public/admin/css/golbal.css" rel="stylesheet" type="text/css" />
<link href="../Public/admin/css/notice.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function gopage(nowpage){
		if(nowpage=='')nowpage=1;
		var totalpage=parseInt("<?php echo $_SESSION['pagetotalPages'];?>");

		if(parseInt(nowpage)==nowpage)
		{
			if(nowpage<=0)
			{
				alert('请输入大于0的整数页码!');
				return false;
			}
			else if(nowpage>totalpage)
			{
				alert('请输入小于最大分页数的整数页码!');
				return false;
			}
		}
		else
		{
			alert('请输入大于0的整数页码!');
			return false;
		}
		var obj=location.href;
		var url=obj.substring(0,obj.indexOf("?")+1);
		var paraString=obj.substring(obj.indexOf("?")+1,obj.length).split("&");
		url="<?php echo $_SESSION['pageurl'];?>";
		url+="&p="+nowpage;
		window.location=url;
	}
</script>
</head>

<body>
<div class="tittle">
<span>评论管理</span>

</div>
<div class="detab">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr class="thi">
<th width="183">资源名称</th>
<th width="90">资源类型</th>
<th width="302">评论内容</th>
<th width="120">评论者 </th>
<th width="163">审核</th>
<th width="100">评论时间 </th>
<th width="80">操作</th>
</tr>
<volist id='vo' name='list'>
<tr>
<td>{$vo.commname|msubstr=###,0,8}</td>
<td>{$vo.comtype}</td>
<td><div style="width:302px;"><p style="word-break: break-all;width:302px;">{$vo.comcontent}</p></div></td>
<td>{$vo.nickname}</td>
<eq name="vo['comstatus']" value="0">
<td class="start" style="padding-left:0px;"><span style="margin-left:10px;width:36px;">通过</span><a href="javascript:void(0);" onclick="forbidden({$vo.comid});"> </a></td>
<else/>
<td class="forbid" style="color:#991C1C; padding-left:0px;"><span style="margin-left:10px;">未通过</span><a href="javascript:void(0);" onclick="enable({$vo.comid});"> </a></td>
</eq>
<td>{$vo.comtime|date="Y-m-d",###}</td>
<td class="last_bt" style="padding-left:33px;"><a href="{:U('Comment/move',array('comid'=>$vo['comid']))}" class="move"onclick="return confirm('确定要删除吗')">删除</a></td>
</tr>
</volist>
</tbody>
</table>
</div>

<div class="num">
{$page}
</div>
<div class="clear"></div>
<script type="text/javascript">

//禁用
function forbidden(cateid) {
	cateid = cateid ? cateid : getChecked();
	cateid = cateid.toString();
	if(cateid == '' || !confirm('确定要取消启用？')) return false;
	$.post("{:U('Comment/forbidden')}", {comid:cateid}, function(res){
		if(res == '1') location.href = location.href;
		else alert('禁用失败');
	});
}

//启用
function enable(cateid) {
	cateid = cateid ? cateid : getChecked();
	cateid = cateid.toString();
	$.post("{:U('Comment/enable')}", {comid:cateid}, function(res){
		if(res == '1') location.href = location.href;
		else alert('激活失败');
	});
}
</script>
</body>
</html>
